1. Field of the Invention
The present invention relates to a method and device for compressing image data by performing zigzag scanning after a fixed delay.
2. Description of the Related Art
In general, huge amounts of image data extracted from an image form the cornerstone of real-time image applications. A system with powerful functions is typically used to process the huge amounts of data. However, powerful functions typically result in complicated circuitry and high cost. Speeding up the transmission rate using high-frequency transmission is a difficult and high-cost solution, since transmission line and media problems must still be dealt with.
Thus, it becomes more and more important to effectively and correctly reduce the volume of image data. Industrial standards, such as moving picture experts group (MPEG) and joint photographic experts group (JPEG), have introduced zigzag scanning to handle converted data resulting from discrete cosine transformation (DCT).
FIG. 1 is an image compression system of the prior art. At the beginning, image data 11 is distributed to an 8.times.8 matrix 12 as shown in FIG. 2a. Through DCT 13, the 8.times.8 matrix 12 will be converted from time domain to frequency domain as shown in FIG. 2b. Referring to FIG. 2b, almost all cells of the converted 8.times.8 matrix are reduced to zero after processing by DCT 13, except for the upper-left corner.
Meanwhile, DCT has a specific data output sequence. 8 elements of the first row of the converted matrix are not generated until the 8th clock after matrix conversion starts, and so forth. That is, the elements of the 8th row are generated after 8.times.8=64th clock.
Zigzag scanning is performed by zigzag scanning 14 after DCT 13. Zigzag scanning 14 can serialize the converted 8.times.8 matrix into a serial chain by placing nonzero values in the front of the serial chain and all zeroes to the end by a specific sequence shown in FIG. 3a and FIG. 3b. In FIG. 3a, the specific sequence of zigzag scanning is depicted by numbers, wherein "0" represents that the related element in the converted 8.times.8 matrix is output first and so forth. To show the output sequence more clearly, FIG. 3b utilities arrows to depict the scan sequence. From FIG. 3b, it becomes apparent why this scan methodology is called "zigzag" scanning.
In an image compressing method, a successive data reading and writing is neccessary. Given the characteristics of DCT, it should be noticeable when the image data is read from the converted matrix and written to the serial chain. That is, data can not be read from the converted matrix before it is valid, and must be written into the serial chain before it is over-written.
After the zigzag scanning 14 is performed, a variable length coding (VLC) 15 is performed. VLC 15 codes a source code of fixed length into a target code of variable length. Usually, coding sources frequently occurring as short target code would highly compress the length of source codes. By introducing VLC, a compression rate of 1/30 or even 1/200 can be achieved.
However, reliance on different clock delays for reading and writing elements in each row of the 8.times.8 matrix when performing the zigzag scan is a disadvantage of the prior art in that it requires complicated circuitry. To archive a complicated circuitry means a lot of transistors is used.